Skip to content

V4 for musl#1012

Merged
WanWizard merged 10 commits intoOpenPLi:developfrom
andrea-adami:musl-v4
Jun 19, 2021
Merged

V4 for musl#1012
WanWizard merged 10 commits intoOpenPLi:developfrom
andrea-adami:musl-v4

Conversation

@andrea-adami
Copy link
Copy Markdown
Contributor

Apart dvd+rw-tools the patches have been cleaned and sent upstream.
See patch header for the fixed errors and commit log for the changes.

Thanks for reviewing it!
A.A.

Needed for build against musl libc

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Needed for build against musl libc

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
fix warnings
patches sent upstream

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
fix warnings
patches sent upstream

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
fix
growisofs.c:661:17: warning: implicit declaration of function 'major'
growisofs.c:662:17: warning: implicit declaration of function 'minor'

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
fix
error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
 [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
      |  ^~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
fix
 ../../git/src/webrequest.cpp:15:10: fatal error: sys/unistd.h: No such file

patch sent upstream

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
see patch headers for the list of fixes
note that the recipe exhibits severe warnings

patches sent upstream

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
v1
Try to make the code more portable.
Fixes are listed in the patch header.

Note: malloc/mallinfo is not available in musl (deprecated)

patch sent upstream

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
@kueken
Copy link
Copy Markdown
Collaborator

kueken commented Jun 17, 2021

ofgwrite has been updatet
https://github.com/oe-alliance/ofgwrite/commits/master
So the patches are double, right?

Patches accepted upstream

This reverts commit c290b24.
@WanWizard WanWizard merged commit 40675b6 into OpenPLi:develop Jun 19, 2021
@persianpros
Copy link
Copy Markdown
Contributor

persianpros commented Jun 20, 2021

@WanWizard

Did you check this PR or you just merged it?

Now you're patching your own enigma2 and tuxtxt instead of merging the related PRs:

OpenPLi/enigma2#3014

OpenPLi/tuxtxt#8

@WanWizard
Copy link
Copy Markdown
Member

Hmm, did I miss something?

I'm busy elsewhere for a few days, and have over 200 github notifications pending in my inbox... :(

@kueken
Copy link
Copy Markdown
Collaborator

kueken commented Jun 20, 2021

not really a problem.
You just have to remember to revert the patches when the PR has been accepted in the other git.
So now enigma2 and tuxtxt here again Revert
bd881fe
e021770
6ca7dbf
need revert now

@WanWizard
Copy link
Copy Markdown
Member

I think I've merged what I can merge, so I now need to revert these three commits?

@persianpros
Copy link
Copy Markdown
Contributor

persianpros commented Jun 20, 2021

@WanWizard

Yep you need to revert those commits and possibly more in future after eriksl/streamproxy#16 got merged.

This PR should have been a draft not a real one and I told in prev ones to go for upstreams not provide patches.

@WanWizard
Copy link
Copy Markdown
Member

Ok, clear.

@WanWizard
Copy link
Copy Markdown
Member

Done.

@persianpros
Copy link
Copy Markdown
Contributor

@WanWizard

This commit should be reverted and applied as a patch against the repo: OpenPLi/enigma2@ad3d13e

It's only the patch file.

@persianpros
Copy link
Copy Markdown
Contributor

persianpros commented Jun 20, 2021

@WanWizard

Also 147a8ff was a correct commit, not sure why @kueken tagged it as one to revert as it's the reason this whole thing exist.

Some of the cleanups in d9fe777#diff-b3965358f2cc5704b05298e6d2989758e27610a5d57bdaaff5b6b0848e75f1d5 were also fine.

What can I say, it's a mess ...

@WanWizard
Copy link
Copy Markdown
Member

Which is why I asked specificly if those three should be reverted, and you said "yes"?

@persianpros
Copy link
Copy Markdown
Contributor

I was referring to my post and the related patches/commits: #1012 (comment)

Maybe I got you wrong or you got me wrong, but I sent the correction for enigma2 repo 👍

@andrea-adami
Copy link
Copy Markdown
Contributor Author

andrea-adami commented Jun 20, 2021

I am sorry, these are fallouts of this PR.

The problem here is IMHO that the recipes are not pinned to a git revision so you do not have control over mainstream changes: recipes are automatically updated to latest.

There wasn't time to send the specific PR for OpenPLi, just the first for ofgwrite.

I sent the patches upstream and the mainainers did just react too fast :) Good so!

My 2 cents.
A.A.

@WanWizard
Copy link
Copy Markdown
Member

Any package than needs specific pinning in the develop branch needs its SRC_REV listed in reporefs.conf, we don't pin in individual recipes.

@andrea-adami
Copy link
Copy Markdown
Contributor Author

@WanWizard

musl build now fails with
NOTE: Runtime target 'glibc-gconv-utf-16' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['glibc-gconv-utf-16']
So yes, that was needed.

Well, how to say, once this is done there will be a next problem for musl, especially for enigma2.
https://sourceware.org/glibc/wiki/Y2038ProofnessDesign

:: musl has moved to 64bit time_t and does not play games like glibc

The issue will impact four recipes: directfb_1.7.7, v4l-utils_1.16.5, busybox_1.31, enigma2
For the first three I found the fixes in meta-openembedded, it's just enigma2 needing some rework about clock_gettimeXX.

Ah, some good news then, I have backported a couple of classes and the whole musl libc + gcompat.
There is really the possibility to use the gcompat loader in a musl environment to link/dlopen prebuilt glibc artifacts.

For the moment I am battling with the serial cable, hoping it's not the connector on the vuduo2.
I will open a thread about musl-images testing.

Cheers
A.A.

@betacentauri
Copy link
Copy Markdown
Contributor

Is the effort really worth?
Did you check whether binaries are running? As far as I heard musl works partly different. And I really fear that e2 don’t work properly.

persianpros referenced this pull request in OpenPLi/enigma2 Jun 21, 2021
* Revert "enigma2: fx build with musl (#3014)"

It's a patch file and should be applied first.

This reverts commit ad3d13e.

* enigma2: fix build with musl

fixes:
 lib/base/thread.cpp:59:5: error: 'struct sched_param' has no member named '__sched_priority';
 lib/base/e2avahi.cpp:154:37: error: missing sentinel in function call [-Werror=format=]
 lib/dvb/epgcache.cpp:400:2: error: 'PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' was not declared in this scope;
 lib/dvb/epgtransponderdatareader.cpp:10:65: error: 'PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' was not declared in this scope;
 lib/gdi/gpixmap.cpp:9:2: error: #error "no BYTE_ORDER defined!"
 lib/gdi/font.cpp:35:31: error: 'PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP' was not declared in this scope;
 lib/gdi/pixmapcache.h:11:9: error: 'uint' does not name a type; did you mean 'rint'?
 lib/gdi/pixmapcache.cpp:134:30: error: 'MaximumSize' was not declared in this scope
 lib/gdi/font.cpp:35:31: error: 'PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP' was not declared in this scope;
 lib/gdi/pixmapcache.h:11:9: error: 'uint' does not name a type; did you mean 'rint'?
 lib/gdi/pixmapcache.cpp:8:1: error: 'uint' does not name a type; did y
 lib/gdi/pixmapcache.cpp:134:30: error: 'MaximumSize' was not declared

 Plugins/Extensions/SocketMMI/src/socket_mmi.cpp:1:
 ...../usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect
  include <sys/poll.h> to <poll.h> [-Werror=cpp]

lib/gdi/font.cpp:35:31: error: 'PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP' was not declared in this scope;
main/bsod.cpp:6:10: fatal error: execinfo.h: No such file or directory
main/enigma.cpp:357:18: error: variable 'dump_malloc_stats()::mallinfo mi' has initializer but incomplete type
main/enigma.cpp:357:32: error: invalid use of incomplete type 'struct dump_malloc_stats()::mallinfo'

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: persianpros <persianpros@yahoo.com>

Co-authored-by: Andrea Adami <andrea.adami@gmail.com>
@WanWizard
Copy link
Copy Markdown
Member

I wonder exactly the same. Also because the space you might save is relatively insignificant, we'll have to decide to drop boxes with 128Mb flash sooner rather than later...

@persianpros
Copy link
Copy Markdown
Contributor

If you can save them why not?

Let him go for it and don't lose hope just now.

@betacentauri
Copy link
Copy Markdown
Contributor

betacentauri commented Jun 21, 2021

I don't want to stop him. But there are several things which work different:
https://wiki.musl-libc.org/functional-differences-from-glibc.html
If I read read/write, signaling, threads,... behave different, I have not a good feeling as it might cause bugs, which are not easy to find. And that the code compiles is not enough for testing ;-)

Maybe better start with some applications which are known work with musl.

@WanWizard
Copy link
Copy Markdown
Member

Me neither. But we have to be careful not to end up with a lot of complexity and instability, for not a lot of gain...

@andrea-adami
Copy link
Copy Markdown
Contributor Author

andrea-adami commented Jun 21, 2021

So, about musl, I am nor the author nor a lobbyst :)
BTW I cannot imagine any instability coming from these patches, surely not for glibc-builds.

As for OpenEmbedded, the outstanding work of Khem provides full musl-compatibility for oe-core and I'd say for meta-oe as well.

It's maybe interesting to see how it helps the older devices like vusolo, having less (glibc-)binary drivers in the image.
As for run-tests on vuduo2, I have yet to see what happens to eudev,, I don't think enigma2 will be a probelm.

devtmpfs: mounted
Freeing unused kernel memory: 228K (80757000 - 80790000)
INIT: version 2.88 booting
Fuse filesystem already available.
Mounting fuse control fi�esystem.
Starting udev
udevd[89]: starting version 3.2.8
udevd[90]: starting eudev-3.2.8
UBI error: ubi_open_�olume: cannot open device 0, volume 0, error -16
usb 4-1: reset high-speed USB device number 2 using ehci-brcm
ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5392, rev 0223 detected
ieee80211 ph�0: rt2x00_set_rf: Info - RF chipset 5372 d�tected
usbcore: registered new interface dr�ver rt2800usb
block sda1: uevent: unknown action-string
block sda: u�vent: unknown action-string
block lo�p0: uevent: unknown action-string
block loo�1: uevent: unknown action-string
blo�k loop2: uevent: unknown action-string
block loop3: uevent: unknown action-string
block loop4: uevent: unknown action-string
block loop5: uevent: unknown action-string
block loop6: uevent: unknown action-string
blo�k loop7: uevent: unknown action-string
block mtdblock0: uevent: unknown action-string
block mtdblock1: uevent: unknown action-string
block mtdblock2: uevent: unknown action-string
block mtdblock3: uevent: unknown action-string
block mtdblock4: uevent: unknown action-string
UBI error: ubi_open_volume: cannot open device 0, volume 0, error -16
/dev/dvb/adapter0/video0: No such fil� or directory

So before testing gcompat for dlopen() I must get to console :/
https://git.adelielinux.org/adelie/gcompat

A.A.

@betacentauri
Copy link
Copy Markdown
Contributor

Looks like drivers don’t get loaded.
Or Ubi filesystem cannot be loaded (but I think I saw such errors before and the box had no problems).

@andrea-adami
Copy link
Copy Markdown
Contributor Author

About ubi, yes, something fails to open_volume() once mtd0 is already attached (initscripts or udev rule I think).
This is the normal log with glibc userspace:

Creating 4 MTD partitions on "brcmnand.0":
0x000002700000-0x000040000000 : "rootfs"
0x000002700000-0x000040000000 : "rootfs(redundant)"
0x000000200000-0x000000900000 : "kernel"
0x000000900000-0x000000b00000 : "mac"
UBI: attaching mtd0 to ubi0
random: nonblocking pool is initialized
UBI: scanning is finished
UBI: attached mtd0 (name "rootfs", size 985 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 7876, bad PEBs: 4, corrupted PEBs: 0
UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 484/266, WL threshold: 4096, image sequence number: 1139245285
UBI: available PEBs: 0, total reserved PEBs: 7876, PEBs reserved for bad PEB handling: 156
UBI: background thread "ubi_bgt0d" started, PID 52
ALSA device list:
No soundcards found.
UBIFS: parse sync
UBIFS: background thread "ubifs_bgt0_0" started, PID 55
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
UBIFS: FS size: 978350080 bytes (933 MiB, 7705 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
UBIFS: reserved for root: 0 bytes (0 KiB)
UBIFS: media format: w4/r0 (latest is w4/r0), UUID 7B50846F-11D9-4B09-9B85-404100AD8046, small LPT model
VFS: Mounted root (ubifs filesystem) on device 0:12.
devtmpfs: mounted
Freeing unused kernel memory: 228K (80757000 - 80790000)
udevd[88]: starting version 3.2.8
udevd[89]: starting eudev-3.2.8
UBI error: ubi_open_volume: cannot open device 0, volume 0, error -16
usb 4-1: reset high-speed USB device number 2 using ehci-brcm
ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5392, rev 0223 detected
ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5372 detected
ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
usbcore: registered new interface driver rt2800usb
UBI error: ubi_open_volume: cannot open device 0, volume 0, error -16
EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
procmk_init
bcm_event: module license 'Proprietary' taints kernel.
Disabling lock debugging due to kernel taint
Booted !
DVB: registering new adapter (vuplus_duo2)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants